<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="zh">
<head>
<%@include file="../../commons/meta.jsp"%>
<c:set var="baseUrl" value="${ctx}api/university/" scope="request"/>
<link rel="stylesheet" href="${ctx}assets/plugins/pure/pure-min.css" media="all" />
<script type="text/javascript" src="${ctx}assets/plugins/plupload/2.2.1/js/plupload.full.min.js"></script>
<script type="text/javascript" src="${ctx}assets/plugins/plupload/2.2.1/js/i18n/zh_CN.js"></script>
<script type="text/javascript">
  function validateForm() {
    if (empty($("#name").val())) {
      alertError('请输入学校名称！');
      return false;
    }
    if (empty($("#address").val())) {
      alertError('请输入详细地址！');
      return false;
    }

    if(isNaN($("#bohouPoints").val())){
      alertError('博士后点位，请输入数字！');
      return false;
    }

    if(isNaN($("#boPoints").val())){
      alertError('博士点位，请输入数字！');
      return false;
    }

    if(isNaN($("#shuoPoints").val())){
      alertError('硕士点位，请输入数字！');
      return false;
    }
    $("#forms").submit();
  }
  //  关闭弹出框 
  jQuery(document).ready(function() {
    $("#back_btn").click(function() {
      window.location.href = "${baseUrl}"
    });
  });
</script>
</head>
<body>
    <%@include file="../../commons/head.jsp"%>
    <div class="content">
        <%@include file="../../commons/menu.jsp"%>
        <!--右侧展示部分-->
        <div class="right-zq">
            <!--center content-->
            <div class="dynamic">
                <div class="role dynamiclayer" style="display: block;">
                    <div class="title orange2">
                        <span class="left">高校信息管理</span> <label> > </label> <span>学校信息管理</span> <label> > </label> <span>添加</span>
                    </div>
                    <form class="" id="forms" method="post" action="${baseUrl}update">
                        <div class="news-table">
                            <table>
                                <tr>
                                    <td class="item">学校代码:</td>
                                    <td width="60%">
                                        <input type="hidden" id="id" name="id" value="${obj.id}" />
                                        <input class="p100" id="code" name="code" type="text" placeholder="请输入学校代码" value="${obj.code}" />
                                    </td>
                                </tr>
                                <tr>
                                    <td class="item">学校名称:<span class="error">*</span></td>
                                    <td width="60%"><input class="p100" id="name" name="name" type="text" placeholder="请输入学校名称" value="${obj.name}" /></td>
                                </tr>
                                <tr>
                                    <td class="item">学校官网:</td>
                                    <td width="60%"><input class="p100" id="website" name="website" type="text" placeholder="请输入学校官网地址" value="${obj.website}" /></td>
                                </tr>
                                <tr>
                                    <td class="item">学校简称:</td>
                                    <td width="60%"><input class="p100" id="shortName" name="shortName" type="text" placeholder="请输入学校简称" value="${obj.shortName}" /></td>
                                </tr>
                                <tr>
                                    <td class="item">英文校名:</td>
                                    <td width="60%"><input class="p100" id="enName" name="enName" type="text" placeholder="请输入学校英文名称" value="${obj.enName}" /></td>
                                </tr>
                                <tr>
                                    <td class="item">校训:</td>
                                    <td width="60%"><input class="p100" id="motto" name="motto" type="text" placeholder="请输入校训" value="${obj.motto}" /></td>
                                </tr>
                                <tr>
                                    <td class="item">大学层次:</td>
                                    <td width="60%">
                                        <select name="level" class="input1 p100" style="text-align: center;">
                                            <option value="">请选择</option>
                                            <option value="1" <c:if test="${obj.level == '1'}">selected="selected"</c:if>>本科</option>
                                            <option value="3" <c:if test="${obj.level == '3'}">selected="selected"</c:if>>专科</option>
                                        </select>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="item">办学性质:</td>
                                    <td width="60%">
                                        <select name="classify" class="input1 p100" style="text-align: center;">
                                            <option value="">请选择</option>
                                            <option value="公办" <c:if test="${obj.classify == '公办'}">selected="selected"</c:if>>公办</option>
                                            <option value="民办" <c:if test="${obj.classify == '民办'}">selected="selected"</c:if>>民办</option>
                                        </select>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="item">建校年份:</td>
                                    <td width="60%">
                                        <input class="p100" id="creation" name="creation" type="text" placeholder="请输入建校年份" value="${obj.creation}" maxlength="4"/>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="item">校庆日:</td>
                                    <td width="60%">
                                        <input class="p100" id="anniversary" name="anniversary" type="text" placeholder="请输入校庆日，如 6月8日" value="${obj.anniversary}" maxlength="10"/>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="item">学校类型:</td>
                                    <td width="60%">
                                        <input class="p100" id="type" name="type" type="text" placeholder="请输入学校类型，综合，财经等" value="${obj.type}" />
                                    </td>
                                </tr>
                                <tr>
                                    <td class="item">校徽地址:</td>
                                    <td width="60%">
                                        <input class="p100" id="logoUrl" name="logoUrl" type="text" placeholder="请输入百科上校徽图片URL" value="${obj.logoUrl}" />
                                    </td>
                                </tr>
                                <tr>
                                    <td class="item">全国排名:</td>
                                    <td width="60%">
                                        <input class="p100" id="rank" name="rank" type="text" placeholder="请输入学校的全国排名" value="${obj.rank}" />
                                    </td>
                                </tr>
                                <tr>
                                    <td class="item">学校标签:</td>
                                    <td width="60%">
                                        <input class="p100" id="tags" name="tags" type="text" placeholder="请输入学校标签#211工程#985工程#双一流#全国重点等#等" value="${obj.tags}" />
                                    </td>
                                </tr>
                                <tr>
                                    <td class="item">博士后点位:</td>
                                    <td width="60%">
                                        <input class="p100" id="bohouPoints" name="bohouPoints" type="text" placeholder="请输入学校博士后点位数" value="${obj.bohouPoints}" maxlength="4"/>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="item">博士点位:</td>
                                    <td width="60%">
                                        <input class="p100" id="boPoints" name="boPoints" type="text" placeholder="请输入学校博士点位数" value="${obj.boPoints}" maxlength="4"/>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="item">硕士点位:</td>
                                    <td width="60%">
                                        <input class="p100" id="shuoPoints" name="shuoPoints" type="text" placeholder="请输入学校硕士点位数" value="${obj.shuoPoints}" maxlength="4"/>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="item">现任领导:</td>
                                    <td width="60%">
                                        <input class="p100" id="leader" name="leader" type="text" placeholder="请输入学校现任领导" value="${obj.leader}" maxlength="20"/>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="item">知名校友:</td>
                                    <td width="60%">
                                        <input class="p100" id="classmate" name="classmate" type="text" placeholder="请输入学校知名校友" value="${obj.classmate}" maxlength="200"/>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="item">所在省:</td>
                                    <td width="60%">
                                        <input class="p100" id="provinceName" name="provinceName" type="text" placeholder="请输入所在省/直辖市" value="${obj.provinceName}" maxlength="200"/>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="item">所在市:</td>
                                    <td width="60%">
                                        <input class="p100" id="cityName" name="cityName" type="text" placeholder="请输入所在市" value="${obj.cityName}" maxlength="200"/>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="item">详细地址:<span class="error">*</span></td>
                                    <td width="60%">
                                        <input class="p100" id="address" name="address" type="text" placeholder="请输入学校详细地址" value="${obj.address}" maxlength="360"/>
                                    </td>
                                </tr>
                                <tr>
                                    <td></td>
                                    <td>
                                        <button class="orange2" type="button" onclick="validateForm()">保存&nbsp;<i class="fa fa-floppy-o"></i>
                                        </button> &nbsp;&nbsp;
                                        <button class="orange2" type="button" id="back_btn">返回&nbsp;<i class="fa fa-undo"></i>
                                        </button>
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </form>
                </div>
            </div>
            <!--center content over-->
        </div>
    </div>
    <%@include file="../../commons/footpop.jsp"%>
    <!-- 页尾，提示消息 -->
    <jsp:include page="../../commons/foot_message.jsp"></jsp:include>
<script type="text/javascript">

</script>
</body>
</html>
